var e = require("../../../../@babel/runtime/helpers/typeof"), t = require("../../../../common/vendor.js"), i = require("../../../uv-ui-tools/libs/mixin/mpMixin.js"), n = require("../../../uv-ui-tools/libs/mixin/mixin.js"), r = require("./props.js");

require("../../../uv-ui-tools/libs/function/index.js"), require("../../../uv-ui-tools/libs/function/test.js"), 
require("../../../uv-ui-tools/libs/function/digit.js"), require("../../../uv-ui-tools/libs/util/route.js"), 
require("../../../uv-ui-tools/libs/function/debounce.js"), require("../../../uv-ui-tools/libs/function/throttle.js");

var o = {
    name: "uv-swiper",
    mixins: [ i.mpMixin, n.mixin, r.props ],
    emits: [ "click", "change" ],
    data: function() {
        return {
            currentIndex: 0
        };
    },
    watch: {
        current: function(e, t) {
            e !== t && (this.currentIndex = e);
        }
    },
    computed: {
        itemStyle: function() {
            var e = this;
            return function(t) {
                var i = {};
                return e.nextMargin && e.previousMargin && (i.borderRadius = e.$uv.addUnit(e.radius), 
                t !== e.currentIndex && (i.transform = "scale(0.92)")), i;
            };
        }
    },
    methods: {
        getItemType: function(t) {
            return "string" == typeof t ? this.$uv.test.video(this.getSource(t)) ? "video" : "image" : "object" == e(t) && this.keyName ? t.type ? "image" === t.type ? "image" : "video" === t.type ? "video" : "image" : this.$uv.test.video(this.getSource(t)) ? "video" : "image" : void 0;
        },
        getSource: function(t) {
            return "string" == typeof t ? t : "object" == e(t) && this.keyName ? t[this.keyName] : (this.$uv.error("请按格式传递列表参数"), 
            "");
        },
        change: function(e) {
            var t = e.detail.current;
            this.pauseVideo(this.currentIndex), this.currentIndex = t, this.$emit("change", e.detail);
        },
        pauseVideo: function(e) {
            var i = this.getSource(this.list[e]);
            this.$uv.test.video(i) && t.index.createVideoContext("video-".concat(e), this).pause();
        },
        getPoster: function(t) {
            return "object" == e(t) && t.poster ? t.poster : "";
        },
        clickHandler: function(e) {
            this.$emit("click", e);
        }
    }
};

Array || (t.resolveComponent("uv-loading-icon") + t.resolveComponent("uv-swiper-indicator"))(), 
Math || (function() {
    return "../../../uv-loading-icon/components/uv-loading-icon/uv-loading-icon.js";
} + function() {
    return "../uv-swiper-indicator/uv-swiper-indicator.js";
})();

var u = t._export_sfc(o, [ [ "render", function(e, i, n, r, o, u) {
    return t.e({
        a: e.loading
    }, e.loading ? {
        b: t.p({
            mode: "circle"
        })
    } : {
        c: t.f(e.list, function(i, n, r) {
            return t.e({
                a: "image" === u.getItemType(i)
            }, "image" === u.getItemType(i) ? {
                b: u.getSource(i),
                c: e.imgMode,
                d: t.o(function(e) {
                    return u.clickHandler(n);
                }, n),
                e: e.$uv.addUnit(e.height),
                f: e.$uv.addUnit(e.radius)
            } : {}, {
                g: "video" === u.getItemType(i)
            }, "video" === u.getItemType(i) ? {
                h: "video-".concat(n),
                i: u.getSource(i),
                j: u.getPoster(i),
                k: e.showTitle && e.$uv.test.object(i) && i.title ? i.title : "",
                l: e.$uv.addUnit(e.height),
                m: t.o(function(e) {
                    return u.clickHandler(n);
                }, n)
            } : {}, {
                n: e.showTitle && e.$uv.test.object(i) && i.title
            }, e.showTitle && e.$uv.test.object(i) && i.title ? {
                o: t.t(i.title),
                p: t.s(e.$uv.addStyle(e.titleStyle))
            } : {}, {
                q: t.s(u.itemStyle(n)),
                r: n
            });
        }),
        d: e.$uv.addUnit(e.height),
        e: t.o(function() {
            return u.change && u.change.apply(u, arguments);
        }),
        f: e.circular,
        g: e.vertical,
        h: e.interval,
        i: e.duration,
        j: e.autoplay,
        k: e.current,
        l: e.currentItemId,
        m: e.$uv.addUnit(e.previousMargin),
        n: e.$uv.addUnit(e.nextMargin),
        o: e.acceleration,
        p: e.displayMultipleItems,
        q: e.easingFunction
    }, {
        r: !e.loading && e.indicator && !e.showTitle
    }, e.loading || !e.indicator || e.showTitle ? {} : {
        s: t.p({
            indicatorActiveColor: e.indicatorActiveColor,
            indicatorInactiveColor: e.indicatorInactiveColor,
            length: e.list.length,
            current: o.currentIndex,
            indicatorMode: e.indicatorMode
        })
    }, {
        t: t.s(e.$uv.addStyle(e.indicatorStyle)),
        v: e.bgColor,
        w: e.$uv.addUnit(e.height),
        x: e.$uv.addUnit(e.radius)
    });
} ], [ "__scopeId", "data-v-909a6243" ] ]);

wx.createComponent(u);